$('#formSignup').on('submit', function(e) {
    var details = $('#formSignup').serialize();
    var username = $('#name').val();
    var pass = $('#pwd').val();
    var url = 'http://uneven.live:8080/login';
    var $status = $('#status');
    e.preventDefault();
    /*Check username & password */
    if (!username || !pass) {
        $status.html('<div class="error-status">请填写昵称及密码</div>');
        return;
    }
    $.ajax({
        type: "POST",
        url: url,
        timeout: 3000,
        data: details,
        beforeSend: function() {
            $status.append('<div class="status">登录中……</div>');
        },
        complete: function() {
            $('div.status').remove();
        },
        success: function(data) {
            if (data.Code == 0) {
                location.href = "http://uneven.live:8080";
            } else {
                $status.html('<div class="error-status">' + data.Msg + '</div>');

            }
        },
        fail: function() {
            $status.html('<div class="error-status">无法连接服务器，请稍后再试</div>');
        }
    });
});